
#ifndef _ST_TASK_H_
#define _ST_TASK_H_


#ifdef  ST_SDL_WRAPPER
/* SDL_WRAPPER{{{1 */
#include <SDL.h>
#include <SDL_thread.h>

typedef st_sint32   (*st_task_proc)(void* arg);
typedef SDL_Thread  st_task;

#define st_task_Create(proc, arg)       SDL_CreateThread(proc, arg)
#define st_task_Free(task, status)      SDL_WaitThread(task, status)
#define st_task_Kill(task)              SDL_KillThread(task)

/* SDL_WRAPPER END}}}1 */
#else
/* STANDALONE{{{1 */
//
///* DO NOT change this variable in user tasks */
//extern st_boolean st_task_need_reschedule;
//
//#define ST_TASK_DO      do 
//#define ST_TASK_WHILE   while(!st_task_need_reschedule)
//
//enum _st_task_state
//{
//    ST_TASK_IDLE=0,
//    ST_TASK_READY,
//    ST_TASK_RUNNING
//};
//typedef enum _st_task_state st_task_state;
//
//struct _st_task
//{
//    st_uint8        id;
//    st_uint8        prio;                       /* priority */
//    st_task_state   state;
//    // trigger condition;
//
//    void        (*proc)(void* arg);
//};
//typedef struct _st_task st_task;
//    
//void st_task_Schedule(void);
/* STANDALONE END}}}1 */
#endif

#endif



